#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 50;
const int M = 1e9 + 7;

int t, n;
string s;


int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> t;
    while (t--) {
        cin >> n >> s;
        int a = 0, b = 0;
        for (auto ch : s) ch == 'a' ? a++ : b++;
        if (!a || !b) {
            cout << "-1 -1" << endl;
            continue;
        }

        for (int i = 0; i < n - 1; i++) {
            if (s[i] != s[i + 1]) {
                cout << i+1 << ' ' << i + 2 << endl;
                break;
            }
        }
    }
    return 0;
}